/*
 * @Author: wukunling 13022195532@163.com
 * @Date: 2025-01-01 17:04:23
 * @LastEditors: wukunling 13022195532@163.com
 * @LastEditTime: 2025-01-01 18:06:16
 * @FilePath: /nest-admin/src/config/redis.config.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { ConfigType, registerAs } from '@nestjs/config'

import { env, envNumber } from '~/global/env'

export const redisRegToken = 'redis'

export const RedisConfig = registerAs(redisRegToken, () => ({
  host: env('REDIS_HOST', '127.0.0.1'),
  port: envNumber('REDIS_PORT', 6379),
  // password: env('REDIS_PASSWORD'),
  db: envNumber('REDIS_DB'),
}))

export type IRedisConfig = ConfigType<typeof RedisConfig>
